<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>

</body>
<script>
  var a =1;
  function f1 () {
    let a = 2;
    console.log(this.a) //1
    console.log(a) //2
    console.log(a+this.a)
  }
  function f2 () {
    let a = 10;
    f1()
  }
  f2()
  f3 = new f1();
  function f4 () {
    f3.prototype = {
      a: 3
    }
  }
  f4.call(f1)
  function is_weixin() {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
      return true;
    } else {
      return false;
    }
  }
  console.log(is_weixin())
</script>

</html>
